package com.siashan.toolkit.oss.qiniu;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 七牛云OSS自动配置
 *
 * @author  siashan
 * @since  v1.0.1
 **/
@Configuration
@EnableConfigurationProperties(QiniuOssProperties.class)
public class QiniuOssAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public QiniuOssProperties qiniuOssProperties() {
        return new QiniuOssProperties();
    }


    @Bean
    @ConditionalOnMissingBean
    public QiniuOssFactoryProvider aliPayFactoryProvider(QiniuOssProperties qiniuOssProperties){
        return new QiniuOssFactoryProvider(qiniuOssProperties);
    }
}
